<template>
  <div>
    <Header></Header>
    <section>
      <Routers></Routers>
      <div id="section" class="main">
        <ul>
          <!--公司信息-->
          <li>
            <div class="common_header">
              <span class="header_tip">公司信息</span>
              <button class="header_btn" @click="editCompanyInformation">编辑</button>
            </div>
            <ul class="CompanyInformationLIST_box">
              <!--<li class="CompanyInformationLIST" v-for="item in CompanyInformationLIST">-->
              <!--<span class="common_content_tip">{{item.tip}}：</span>-->
              <!--<span class="common_contents">{{item.content}}</span>-->
              <!--</li>-->
              <li class="CompanyInformationLIST">
                <span class="common_content_tip">企业名称：</span>
                <span class="common_contents">{{Company_name}}</span>
              </li>
              <li class="CompanyInformationLIST">
                <span class="common_content_tip">统一社会信用代码：</span>
                <span class="common_contents">{{Company_num}}</span>
              </li>
              <li class="CompanyInformationLIST">
                <span class="common_content_tip">注册时间：</span>
                <span class="common_contents">{{Company_time}}</span>
              </li>
              <li class="CompanyInformationLIST">
                <span class="common_content_tip">注册类型：</span>
                <span class="common_contents">{{Company_type}}</span>
              </li>
              <li class="CompanyInformationLIST">
                <span class="common_content_tip">注册资金(万)：</span>
                <span class="common_contents">{{Company_money}}</span>
              </li>
              <li class="CompanyInformationLIST">
                <span class="common_content_tip">外贸来源地：</span>
                <span class="common_contents">{{Company_orgin_area}}</span>
              </li>
              <li class="CompanyInformationLIST">
                <span class="common_content_tip">所属行业：</span>
                <span class="common_contents">{{Company_industry}}</span>
              </li>
              <li class="CompanyInformationLIST">
                <span class="common_content_tip">企业规模(人)：</span>
                <span class="common_contents">{{Company_peopleum}}</span>
              </li>
              <li class="CompanyInformationLIST">
                <span class="common_content_tip">行政区域：</span>
                <span class="common_contents">{{Company_area}}</span>
              </li>
              <li class="CompanyInformationLIST">
                <span class="common_content_tip">企业所得税征收机关：</span>
                <span class="common_contents">{{Company_shui}}</span>
              </li>
              <li class="CompanyInformationLIST">
                <span class="common_content_tip">通信地址：</span>
                <span class="common_contents">{{Company_address}}</span>
              </li>
              <li class="CompanyInformationLIST">
                <span class="common_content_tip">企业所得税征收方式：</span>
                <span class="common_contents">{{Company_shui_type}}</span>
              </li>
              <li class="CompanyInformationLIST">
                <span class="common_content_tip">是否上市：</span>
                <span class="common_contents">{{Company_shangshi}}</span>
              </li>
              <li class="CompanyInformationLIST">
                <span class="common_content_tip">是否属于国家级高新区内企业：</span>
                <span class="common_contents">{{Company_jishu}}</span>
              </li>
              <li class="CompanyInformationLIST">
                <span class="common_content_tip">上市时间：</span>
                <span class="common_contents">{{Company_shangshi_time}}</span>
              </li>
              <li class="CompanyInformationLIST">
                <span class="common_content_tip">高新区名称：</span>
                <span class="common_contents">{{Company_gaoxinqu_name}}</span>
              </li>
              <li class="CompanyInformationLIST">
                <span class="common_content_tip">股票代码：</span>
                <span class="common_contents">{{Company_gupiao_num}}</span>
              </li>
              <li class="CompanyInformationLIST">
                <span class="common_content_tip">上市类型：</span>
                <span class="common_contents">{{Company_shangshi_type}}</span>
              </li>
              <li class="">
                <span class="common_content_tip">申请认定前一年内是否发生过重大安全、重大质量事故或严重环境违法行为：</span>
                <span class="common_contents">{{Company_danger}}</span>
              </li>
            </ul>
          </li>
          <!--法人信息-->
          <li>
            <div class="common_header">
              <span class="header_tip">法人信息</span>
              <button class="header_btn" v-if="!legalISedit" @click="legalISedits">编辑</button>
              <button class="header_btn" v-if="legalISedit" @click="legalISsaves">保存</button>
            </div>
            <ul class="legalInformationLIST_box">
              <li class="legalInformationLIST" v-for="(item, index) in legalInformationLIST">
                <span class="common_content_tip">{{item.tip}}：</span>
                <span class="common_contents" v-if="!legalISedit">{{item.content}}</span>
                <input type="text" v-if="legalISedit" v-model="item.content" :placeholder="item.place_text" :class="{'error':item.error}">
              </li>
            </ul>
          </li>
          <!--联系人信息-->
          <li>
            <div class="common_header">
              <span class="header_tip">联系人信息</span>
              <button class="header_btn" v-if="!ContactsISedit" @click="ContactsISedits">编辑</button>
              <button class="header_btn" v-if="ContactsISedit" @click="ContactsISsaves">保存</button>
            </div>
            <ul class="ContactsInformationLIST_box">
              <li class="ContactsInformationLIST" v-for="item in ContactsInformationLIST">
                <span class="common_content_tip">{{item.tip}}：</span>
                <span class="common_contents" v-if="!ContactsISedit">{{item.content}}</span>
                <input type="text" v-if="ContactsISedit" v-model="item.content" :placeholder="item.place_text" :class="{'error':item.error}">
              </li>
            </ul>
          </li>
          <!--股东信息-->
          <li class="Shareholder">
            <div class="common_header">
              <span class="header_tip">股东信息</span>
              <button class="header_btn" @click="add_Shareholder">添加</button>
            </div>
            <table class="Shareholder_table" cellpadding="0" cellspacing="0">
              <thead>
              <tr>
                <th>股东</th>
                <th>持股比例</th>
                <th>出资额</th>
                <th>股东类型</th>
                <th>身份证/社会统一信用代码</th>
                <th>操作</th>
              </tr>
              </thead>
              <tbody>
              <tr v-for="(item ,index) in ShareholderLIST" :key="index">
                <td>
                  <span>{{item.share_holder}}</span>
                </td>
                <td>
                  <span>{{item.share_percent}}%</span>
                </td>
                <td>
                  <span>{{item.share_money}}</span>
                </td>
                <td>
                  <span>{{item.share_holder_type}}</span>
                </td>
                <td>
                  <span>{{item.code}}</span>
                </td>
                <td class="operation_td">
                  <span class="Shareholder_editBTN" @click="Shareholder_edit(item.id)">编辑</span>
                  <!--<span class="Shareholder_editBTN" @click="Shareholder_save(index)" v-if="ShareholderISedit[index]">保存</span>-->
                  <span class="Shareholder_delBTN" @click="Shareholder_del(item.id,index)">删除</span>
                </td>
              </tr>
              </tbody>
            </table>
          </li>
          <!--人员结构-->
          <li>
            <div class="common_header">
              <span class="header_tip">全体人员结构</span>
            </div>
            <table id="peopleStructure" cellpadding="0" cellspacing="0">
              <tr>
                <th>学历</th>
                <th>博士</th>
                <th>硕士</th>
                <th>本科</th>
                <th>大专及以下</th>
              </tr>
              <tr>
                <td>人数</td>
                <td v-for="item in xueli_list">{{item}}</td>
              </tr>
              <tr>
                <th>职称</th>
                <th>高级职称</th>
                <th>中级职称</th>
                <th>初级职称</th>
                <th>高级技工</th>
              </tr>
              <tr>
                <td>人数</td>
                <td v-for="item in zhicheng_list">{{item}}</td>
              </tr>
              <tr>
                <th>年龄</th>
                <th>30及以下</th>
                <th>31-40</th>
                <th>41-50</th>
                <th>51及以上</th>
              </tr>
              <tr>
                <td>人数</td>
                <td v-for="item in age_list">{{item}}</td>
              </tr>
            </table>
          </li>
          <!--营业执照扫描上传-->
          <li>
            <div class="common_header">
              <span class="header_tip">企业信息认证</span>
            </div>
            <div class="upload_box">
              <img :src=yinyezhizhao_img_src alt="图片加载失败">
              <!--<img src="./img/upload.png" alt="">-->
              <input type="file" @change="upload($event)">
              <p class="font_666_16">请上传营业执照</p>
            </div>

          </li>
        </ul>
        <!--编辑公司信息的弹框-->
        <div class="tankuang_box" v-if="CompanyInformationIS_edit">
          <!--里面的白色盒子（需要自己设置宽高）-->
          <div class="add_tankuang">
            <!--顶部的文字和叉叉（通用）-->
            <div class="add_tankuang_header">
              <span>编辑</span>
              <i class="iconfont icon-guanbi" @click="closeEditBox"></i>
            </div>
            <div class="add_tankuang_content">
              <div class="add_tankuang_content_box">
                <!--这里的内容是根据需要的内容加入（不通用）-->
                <ul class="CompanyInformation_tankuang_content">
                  <li>
                    <span>公司名称：</span>
                    <input type="text" v-model="Company_name_input">
                  </li>
                  <li>
                    <span>统一社会信用代码：</span>
                    <input type="text" v-model="Company_num_input">
                  </li>
                  <li>
                    <span>注册时间：</span>
                    <!--<input type="text" v-model="Company_time_input">-->
                    <vue-datepicker-local v-model="Company_time_input" format="YYYY-MM-DD" class="datepicker"/>
                  </li>
                  <li>
                    <span>注册类型：</span>
                    <input type="text" v-model="Company_type_input">
                  </li>
                  <li>
                    <span>注册资金(万)：</span>
                    <input type="text" v-model="Company_money_input">
                  </li>
                  <li>
                    <span>外贸来源地：</span>
                    <input type="text" v-model="Company_orgin_area_input">
                  </li>
                  <li>
                    <span>所属行业：</span>
                    <input type="text" v-model="Company_industry_input">
                  </li>
                  <li>
                    <span>企业规模(人)：</span>
                    <input type="text" v-model="Company_peopleum_input">
                  </li>
                  <li>
                    <span>行政区域：</span>
                    <input type="text" v-model="Company_area_input">
                  </li>
                  <li>
                    <span>企业所得税征收机关：</span>
                    <!--<input type="text">-->
                    <select v-model="Company_shui_input">
                      <option value="国税">国税</option>
                      <option value="地税">地税</option>
                    </select>
                  </li>
                  <li>
                    <span>通信地址：</span>
                    <input type="text" v-model="Company_address_input">
                  </li>
                  <li>
                    <span>企业所得税征收方式：</span>
                    <!--<input type="text" v-model="Company_shui_type">-->
                    <select v-model="Company_shui_type_input">
                      <option value="查账征收">查账征收</option>
                      <option value="核定征收">核定征收</option>
                    </select>
                  </li>
                  <li>
                    <span>是否上市：</span>
                    <!--<input type="text" v-model="Company_shangshi">-->
                    <!--<div class="radioBOX">-->
                    <!--<input type="radio" name="sex" value='male'/><label>男</label>-->
                    <!--<input name="sex" checked type="radio" value="female"/><label>女</label>-->
                    <!--</div>-->
                    <ul class="radioBOX">
                      <li @click="toggleCompany_shangshi_radio">
                        <i class="inlineBlockIcon radio" :class="{active:Company_shangshi_radio}"></i>
                        <span>是</span>
                      </li>
                      <li @click="toggleCompany_shangshi_radio">
                        <i class="inlineBlockIcon radio" :class="{active:!Company_shangshi_radio}"></i>
                        <span>否</span>
                      </li>
                    </ul>
                  </li>
                  <li>
                    <span>是否属于国家级高新技术企业：</span>
                    <!--<input type="text" v-model="Company_jishu">-->
                    <ul class="radioBOX">
                      <li @click="toggleCompany_jishu_radio">
                        <i class="inlineBlockIcon radio" :class="{active:Company_jishu_radio}"></i>
                        <span>是</span>
                      </li>
                      <li @click="toggleCompany_jishu_radio">
                        <i class="inlineBlockIcon radio" :class="{active:!Company_jishu_radio}"></i>
                        <span>否</span>
                      </li>
                    </ul>
                  </li>
                  <li>
                    <span>上市时间：</span>
                    <input type="text" v-model="Company_shangshi_time_input" readonly v-if="!Company_shangshi_radio">
                    <vue-datepicker-local v-model="Company_shangshi_time_input" format="YYYY-MM-DD" class="datepicker" v-if="Company_shangshi_radio"/>
                  </li>
                  <li>
                    <span>高新区名称：</span>
                    <input type="text" v-model="Company_gaoxinqu_name_input" :readonly="!Company_jishu_radio">
                  </li>
                  <li>
                    <span>股票代码：</span>
                    <input type="text" v-model="Company_gupiao_num_input" :readonly="!Company_shangshi_radio">
                  </li>
                  <li>
                    <span>上市类型：</span>
                    <input type="text" v-model="Company_shangshi_type_input" readonly v-if="!Company_shangshi_radio">
                    <select v-model="Company_shangshi_type_input" v-if="Company_shangshi_radio">
                      <option :value="item" v-for="item in shangshi_type_list">{{item}}</option>
                    </select>
                  </li>
                  <li class="list_chang">
                    <span>申请认定前一年内是否发生过重大安全、重大质量事故或严重环境违法行为：</span>
                    <!--<input type="text" v-model="Company_jishu">-->
                    <ul class="radioBOX">
                      <li @click="toggleCompany_danger_radio">
                        <i class="inlineBlockIcon radio" :class="{active:Company_danger_radio}"></i>
                        <span>是</span>
                      </li>
                      <li @click="toggleCompany_danger_radio">
                        <i class="inlineBlockIcon radio" :class="{active:!Company_danger_radio}"></i>
                        <span>否</span>
                      </li>
                    </ul>
                  </li>
                </ul>
                <!--底部的按钮（通用）-->
                <div class="add_tankuang_btnBOX">
                  <button class="add_tankuang_btn add_tankuang_btn_first" @click="saveCompanyInformation">保存</button>
                  <button class="add_tankuang_btn" @click="cancelSave">取消</button>
                </div>
              </div>
            </div>
          </div>
        </div>

        <!--编辑股东信息的弹框-->
        <div class="tankuang_box" v-if="boxISshow">
          <!--里面的白色盒子（需要自己设置宽高）-->
          <div class="add_tankuang Shareholder_tankuang">
            <!--顶部的文字和叉叉（通用）-->
            <div class="add_tankuang_header">
              <span>{{Shareholder_tankuang_title}}</span>
              <i class="iconfont icon-guanbi" @click="closeBox"></i>
            </div>
            <div class="add_tankuang_content">
              <div class="add_tankuang_content_box">
                <!--这里的内容是根据需要的内容加入（不通用）-->
                <ul class="common_tankuang_content">
                  <li>
                    <span>股东姓名：</span>
                    <input type="text" v-model="name">
                  </li>
                  <li>
                    <span>持股比例：</span>
                    <input type="text" v-model="bili">
                    <!--<select v-model="type">-->
                    <!--<option :value="item.name" v-for="(item, index) in typeList">{{item.name}}</option>-->
                    <!--</select>-->
                  </li>
                  <li>
                    <span>出资额(元)：</span>
                    <input type="text" v-model="money">
                  </li>
                  <li>
                    <span>股东类型：</span>
                    <!--<input type="text" v-model="type">-->
                    <select v-model="type">
                      <option value="自然人">自然人</option>
                      <option value="法人">法人</option>
                    </select>
                  </li>
                  <li>
                    <span>身份证/社会统一信用代码：</span>
                    <input type="text" v-model="num">
                  </li>
                </ul>
                <!--底部的按钮（通用）-->
                <div class="add_tankuang_btnBOX">
                  <button class="add_tankuang_btn add_tankuang_btn_first" @click="save">保存</button>
                  <button class="add_tankuang_btn" @click="cancel">取消</button>
                </div>
              </div>
            </div>
          </div>
        </div>

        <!--删除确认框 -->
        <div class="tankuang_box" v-if="delISshow">
          <div class="tankuang">
            <p class="tankuangMSG">确认删除吗？</p>
            <div class="tankuang_btn_box">
              <button class="tankuang_ok_btn" @click="delBTN">确认</button>
              <button class="tankuang_ok_btn" @click="cancelDel">取消</button>
            </div>
          </div>
        </div>

      </div>
    </section>
  </div>
</template>

<script>
  import Routers from '@/template/routers.vue'
  import Header from '@/template/common_header.vue'
  import VueDatepickerLocal from 'vue-datepicker-local'
  import lu from '@/assets/public.js'
  export default {
    name: 'index1',
    components: {
      Routers,
      Header,
      VueDatepickerLocal
    },
    data () {
      return {
        ID:'',
        Company_name:'',
        Company_num:'',
        Company_time:'',
        Company_type:'',
        Company_money:'',
        Company_orgin_area:'',/*外贸来源地*/
        Company_industry:'',/*行业*/
        Company_peopleum:'',
        Company_area:'',/*行政区域*/
        Company_shui:'',/*税务征收机关*/
        Company_address:'',/*通信地址*/
        Company_shui_type:'',/*税务征收方式*/
        Company_shangshi:'',/*是不是上市了*/
        Company_shangshi_radio:true,/*是不是上市了*/
        Company_jishu:'',/*是不是高新技术企业*/
        Company_jishu_radio:true,/*是不是高新技术企业*/
        Company_shangshi_time:'',/*上市时间*/
        Company_gaoxinqu_name:'',/*高新区名称*/
        Company_gupiao_num:'',/*股票代码*/
        Company_shangshi_type:'',/*上市类型*/
        Company_danger_radio:true,
        /*编辑时的数据*/
        Company_name_input:'',
        Company_num_input:'',
        Company_time_input:'',
        Company_type_input:'',
        Company_money_input:'',
        Company_orgin_area_input:'',/*外贸来源地*/
        Company_industry_input:'',/*行业*/
        Company_peopleum_input:'',
        Company_area_input:'',/*行政区域*/
        Company_shui_input:'',/*税务征收机关*/
        Company_address_input:'',/*通信地址*/
        Company_shui_type_input:'',/*税务征收方式*/
        Company_shangshi_input:'',/*是不是上市了*/
//        Company_shangshi_radio_input:true,/*是不是上市了*/
        Company_jishu_input:'',/*是不是高新技术企业*/
//        Company_jishu_radio_input:true,/*是不是高新技术企业*/
        Company_shangshi_time_input:'',/*上市时间*/
        Company_gaoxinqu_name_input:'',/*高新区名称*/
        Company_gupiao_num_input:'',/*股票代码*/
        Company_shangshi_type_input:'',/*上市类型*/
        Company_danger:'',
        /************/
        CompanyInformationIS_edit:false,/*公司信息是否处于编辑状态*/
        shangshi_type_list:[
          '新三板','深交所中小板','东京','深交所主板','上交所','新加坡','香港','纳斯达克','纽约交易所','四板','伦敦','其他','深交所创业板'
        ],
        legalInformationLIST:[
          {
            tip:'姓名',
            content:'',
            place_text:'',
            error:false,
          },{
            tip:'身份证号/护照号',
            content:'',
            place_text:'',
            error:false,
          },{
            tip:'手机号',
            content:'',
            place_text:'',
            error:false,
          },{
            tip:'电话',
            content:'',
            place_text:'',
            error:false,
          },{
            tip:'邮箱',
            content:'',
            place_text:'',
            error:false,
          },{
            tip:'传真',
            content:'',
            place_text:'',
            error:false,
          }
        ],
        legal_place_text:'',
        ContactsInformationLIST:[
          {
            tip:'姓名',
            content:'',
            place_text:'',
            error:false,
          },{
            tip:'手机号',
            content:'',
            place_text:'',
            error:false,
          },{
            tip:'电话',
            content:'',
            place_text:'',
            error:false,
          },{
            tip:'邮箱',
            content:'',
            place_text:'',
            error:false,
          },{
            tip:'传真',
            content:'',
            place_text:'',
            error:false,
          }
        ],
        legalISedit:false,
        ContactsISedit:false,
        /*股东信息*/
        editID:null,
        name:'',
        bili:'',
        money:'',
        type:'',
        num:'',
        Shareholder_tankuang_title:'',
        ShareholderLIST:[],
        boxISshow:false,/*股东信息的弹框是否打开*/
//        ShareholderISedit:[false,false,false],
        ShareholderISedit:[],
        delISshow:false,
        delID:null,
        delINDEX:null,
        /*人员结构*/
        xueli_list:[],
        zhicheng_list:[],
        age_list:[],
        /*营业执照*/
//        yinyezhizhao_img:null,
        yinyezhizhao_img_src:require('./img/upload.png')
      }
    },
    watch:{
//      'legalInformationLIST':{
//        handler: function(val, oldVal) {
//          console.log(val[0].content)
//        },
//        deep: true
//      }
    },
    mounted: function() {
      this.axios.get('/index/show_com').then((res)=>{
        let data = res.data.com_data
        this.ID = data.id
        this.Company_name = data.com_name
        this.Company_num = data.com_code
        this.Company_time = data.reg_time
        this.Company_type = data.reg_type
        this.Company_money = data.reg_money
        this.Company_orgin_area = data.source
        this.Company_industry = data.industry
        this.Company_peopleum = data.com_scale
        this.Company_area = data.area
        this.Company_shui = data.revenue_office==1?'国税':'地税'
        this.Company_address = data.address
        this.Company_shui_type = data.revenue_way==1?'查账征收':'核定征收'
        this.Company_shangshi = data.is_listed==0?'否':'是'
        this.Company_jishu = data.is_heigh==0?'否':'是'
        this.Company_shangshi_time = data.listed_time
        this.Company_gaoxinqu_name = data.heigh_area
        this.Company_gupiao_num = data.stock_code
        this.Company_shangshi_type = data.listed_type
        this.Company_danger = data.is_danger==0?'否':'是'
        this.legalInformationLIST[0].content = data.legal_name
        this.legalInformationLIST[1].content = data.code
        this.legalInformationLIST[2].content = data.legal_phone
        this.legalInformationLIST[3].content = data.legal_tel
        this.legalInformationLIST[4].content = data.legal_email
        this.legalInformationLIST[5].content = data.legal_fax
        this.ContactsInformationLIST[0].content = data.user_name
        this.ContactsInformationLIST[1].content = data.user_phone
        this.ContactsInformationLIST[2].content = data.user_tel
        this.ContactsInformationLIST[3].content = data.user_email
        this.ContactsInformationLIST[4].content = data.user_fax

        this.ShareholderLIST = res.data.share_data
        let length = res.data.share_data.length
        for(let i=0;i<length;i++){
          this.ShareholderISedit.push(false)
        }

        this.xueli_list = res.data.staff_count[0]
        this.zhicheng_list = res.data.staff_count[1]
        this.age_list = res.data.staff_count[2]
        this.yinyezhizhao_img_src = data.business_license
      })
    },
    methods: {
      /*公司信息*/
      toggleCompany_shangshi_radio () {
        this.Company_shangshi_radio = !this.Company_shangshi_radio
        if(!this.Company_shangshi_radio){
          this.Company_shangshi_time_input = ''
          this.Company_gupiao_num_input = ''
          this.Company_shangshi_type_input = ''
        }
      },
      toggleCompany_jishu_radio () {
        this.Company_jishu_radio = !this.Company_jishu_radio
        if(!this.Company_jishu_radio){
          this.Company_gaoxinqu_name_input = ''
        }
      },
      toggleCompany_danger_radio () {
        this.Company_danger_radio = !this.Company_danger_radio
      },
      saveCompanyInformation () {
//        console.log(this.Company_shangshi_time_input)
//        console.log(this.Company_time_input)
        this.Company_time_input = new Date(this.Company_time_input).toLocaleDateString().replace(/\//ig,"-")
        this.Company_shangshi_time_input = new Date(this.Company_shangshi_time_input).toLocaleDateString().replace(/\//ig,"-")
        this.axios.post('/index/edit_com',{
          id: this.ID,
          com_name: this.Company_name_input,
          com_code: this.Company_num_input,
          reg_time: this.Company_time_input,
//          reg_time: new Date(this.Company_time_input).toLocaleDateString().replace(/\//ig,"-"),
          reg_type: this.Company_type_input,
          reg_money: this.Company_money_input,
          source: this.Company_orgin_area_input,
          industry: this.Company_industry_input,
          com_scale: this.Company_peopleum_input,
          area: this.Company_area_input,
          revenue_office: this.Company_shui_input=='国税'?1:2,
          address: this.Company_address_input,
          revenue_way: this.Company_shui_type_input=='查账征收'?1:2,
          is_listed: this.Company_shangshi_radio?1:0,
          is_heigh: this.Company_jishu_radio?1:0,
          listed_time: this.Company_shangshi_time_input,
//          listed_time: new Date(this.Company_shangshi_time_input).toLocaleDateString().replace(/\//ig,"-"),
          heigh_area: this.Company_gaoxinqu_name_input,
          stock_code: this.Company_gupiao_num_input,
          listed_type: this.Company_shangshi_type_input,
          is_danger: this.Company_danger_radio?1:0,
        }).then((res)=>{
          if(res.data.code==1){
            this.Company_name = this.Company_name_input
            this.Company_num = this.Company_num_input
            this.Company_time = this.Company_time_input
            this.Company_type = this.Company_type_input
            this.Company_money = this.Company_money_input
            this.Company_orgin_area = this.Company_orgin_area_input
            this.Company_industry = this.Company_industry_input
            this.Company_peopleum = this.Company_peopleum_input
            this.Company_area = this.Company_area_input
            this.Company_shui = this.Company_shui_input
            this.Company_address = this.Company_address_input
            this.Company_shui_type = this.Company_shui_type_input
            this.Company_shangshi = this.Company_shangshi_radio?'是':'否'
            this.Company_jishu = this.Company_jishu_radio?'是':'否'
            this.Company_shangshi_time = this.Company_shangshi_time_input
            this.Company_gaoxinqu_name = this.Company_gaoxinqu_name_input
            this.Company_gupiao_num = this.Company_gupiao_num_input
            this.Company_shangshi_type = this.Company_shangshi_type_input
            this.Company_danger = this.Company_danger_radio?'是':'否'

            this.CompanyInformationIS_edit = !this.CompanyInformationIS_edit
          }
        })
      },
      cancelSave () {
        this.CompanyInformationIS_edit = !this.CompanyInformationIS_edit
      },
      closeEditBox () {
        this.CompanyInformationIS_edit = !this.CompanyInformationIS_edit
      },
      editCompanyInformation () {
//        赋予数据
        this.Company_name_input = this.Company_name
        this.Company_num_input = this.Company_num
        this.Company_time_input = this.Company_time
        this.Company_type_input = this.Company_type
        this.Company_money_input = this.Company_money
        this.Company_orgin_area_input = this.Company_orgin_area
        this.Company_industry_input = this.Company_industry
        this.Company_peopleum_input = this.Company_peopleum
        this.Company_area_input = this.Company_area
        this.Company_shui_input = this.Company_shui
        this.Company_address_input = this.Company_address
        this.Company_shui_type_input = this.Company_shui_type
//        this.Company_is_danger_input = this.Company_is_danger
        if(this.Company_shangshi=='是'){
          this.Company_shangshi_radio = true
        }else{
          this.Company_shangshi_radio = false
        }
        if(this.Company_jishu=='是'){
          this.Company_jishu_radio = true
        }else{
          this.Company_jishu_radio = false
        }
        if(this.Company_danger=='是'){
          this.Company_danger_radio = true
        }else{
          this.Company_danger_radio = false
        }
        this.Company_shangshi_time_input = this.Company_shangshi_time
        this.Company_gaoxinqu_name_input = this.Company_gaoxinqu_name
        this.Company_gupiao_num_input = this.Company_gupiao_num
        this.Company_shangshi_type_input = this.Company_shangshi_type
        /*展示编辑框*/
        this.CompanyInformationIS_edit = !this.CompanyInformationIS_edit
      },
      /*法人信息*/
      legalISedits () {
        this.legalISedit = !this.legalISedit
      },
      legalISsaves () {
        if(!lu.regCheck(this.legalInformationLIST[2].content,/^((1[3,5,8][0-9])|(14[5,7])|(17[0,6,7,8])|(19[7]))\d{8}$/)){
          this.legalInformationLIST[2].content = ''
          this.legalInformationLIST[2].place_text = '不合法'
          this.legalInformationLIST[2].error = true
          return
        }else{
          this.legalInformationLIST[2].place_text = ''
          this.legalInformationLIST[2].error = false
        }
        if(!lu.regCheck(this.legalInformationLIST[3].content,/0\d{2,3}-\d{7,8}/)){
          this.legalInformationLIST[3].content = ''
          this.legalInformationLIST[3].place_text = '不合法'
          this.legalInformationLIST[3].error = true
          return
        }else{
          this.legalInformationLIST[3].place_text = ''
          this.legalInformationLIST[3].error = false
        }
        this.axios.post('/index/edit_com',{
          id: this.ID,
          legal_name: this.legalInformationLIST[0].content,
          code: this.legalInformationLIST[1].content,
          legal_phone: this.legalInformationLIST[2].content,
          legal_tel: this.legalInformationLIST[3].content,
          legal_email: this.legalInformationLIST[4].content,
          legal_fax: this.legalInformationLIST[5].content,
        }).then((res)=>{
          if(res.data.code==1){
            this.legalISedit = !this.legalISedit
          }
        })
      },
      /*联系人信息*/
      ContactsISedits () {
        this.ContactsISedit = !this.ContactsISedit
      },
      ContactsISsaves () {
        if(!lu.regCheck(this.ContactsInformationLIST[1].content,/^((1[3,5,8][0-9])|(14[5,7])|(17[0,6,7,8])|(19[7]))\d{8}$/)){
          this.ContactsInformationLIST[1].content = ''
          this.ContactsInformationLIST[1].place_text = '不合法'
          this.ContactsInformationLIST[1].error = true
          return
        }else{
          this.ContactsInformationLIST[1].place_text = ''
          this.ContactsInformationLIST[1].error = false
        }
        if(!lu.regCheck(this.ContactsInformationLIST[2].content,/0\d{2,3}-\d{7,8}/)){
          this.ContactsInformationLIST[2].content = ''
          this.ContactsInformationLIST[2].place_text = '不合法'
          this.ContactsInformationLIST[2].error = true
          return
        }else{
          this.ContactsInformationLIST[2].place_text = ''
          this.ContactsInformationLIST[2].error = false
        }
        this.axios.post('/index/edit_com',{
          id: this.ID,
          user_name: this.ContactsInformationLIST[0].content,
          user_phone: this.ContactsInformationLIST[1].content,
          user_tel: this.ContactsInformationLIST[2].content,
          user_email: this.ContactsInformationLIST[3].content,
          user_fax: this.ContactsInformationLIST[4].content,
        }).then((res)=>{
          if(res.data.code==1){
            this.ContactsISedit = !this.ContactsISedit
          }
        })
      },
      /*股东信息*/
      add_Shareholder () {
        this.editID = null
        this.Shareholder_tankuang_title = '添加'
        this.boxISshow = true
      },
      save () {
//        this.boxISshow = false
        this.axios.post('/index/save_share',{
          id:this.editID||'',
          share_holder:this.name,
          share_money:this.money,
          share_holder_type:this.type,
          share_percent:this.bili,
          code:this.num
        }).then((res)=>{
          if(res.data.code==1){
            this.boxISshow = false
            this.axios.get('/index/share_list').then((res)=>{
              if(res.data.code==1){
                this.ShareholderLIST = res.data.data
              }
            })
            this.editID = null
            this.name = ''
            this.bili = ''
            this.money = ''
            this.type = ''
            this.num = ''
            this.Shareholder_tankuang_title = ''
          }
        })
      },
      Shareholder_edit (id) {
        this.Shareholder_tankuang_title = '编辑'
        this.boxISshow = true
        this.editID = id
        this.axios.get('/index/show_share?id='+id).then((res)=>{
          if(res.data.code==1){
            this.name = res.data.data.share_holder
            this.money = res.data.data.share_money
            this.type = res.data.data.share_holder_type
            this.bili = res.data.data.share_percent
            this.num = res.data.data.code
          }
        })
      },
      Shareholder_del (id,index) {
        this.delID = id
        this.delINDEX = index
        this.delISshow = true
      },
      delBTN () {
        this.axios.post('/index/del_share',{
          id:this.delID
        }).then((res)=>{
          if(res.data.code==1){
            this.ShareholderLIST.splice(this.delINDEX,1)
            this.delISshow = false
          }
        })
      },
      cancelDel () {
        this.delISshow = false
      },
      closeBox () {
        this.boxISshow = false
        this.editID = null
        this.name = ''
        this.bili = ''
        this.money = ''
        this.type = ''
        this.num = ''
        this.Shareholder_tankuang_title = ''
      },
      cancel () {
        this.boxISshow = false
        this.editID = null
        this.name = ''
        this.bili = ''
        this.money = ''
        this.type = ''
        this.num = ''
        this.Shareholder_tankuang_title = ''
      },
      /*营业执照*/
      upload(e){
        let file = e.target.files[0]
        let reader = new FileReader()
        reader.readAsDataURL(file)
        let _this = this
        reader.onload = function(e) {
          new Promise((resolve,reject)=>{
            _this.axios.post('/index/upload_qiniu',{
              code:this.result
            }).then((res)=>{
              if(res.data.code==1){
                resolve(res.data.key)
              }
            })
          }).then((key)=>{
            _this.axios.post('/index/edit_com',{
              id:_this.ID,
              business_license:key
            }).then((res)=>{
              if(res.data.code==1){
                _this.yinyezhizhao_img_src = res.data.business_license
              }
            })
          })
        }
      }
    }
  }
</script>

<style scoped>
  @import '../../assets/public.css';
  @import '//at.alicdn.com/t/font_749860_je5eki3tevb.css';

  #section{
    padding:30px;
  }
  #section>ul>li{
    padding:20px 30px;
    border:1px solid #f1f1f1;
  }
  #section>ul>li:not(:last-child){
    margin-bottom:30px;

  }
  .common_header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom:1px solid #f1f1f1;
  }
  .header_tip{
    color: #4797D4;
    font-size:16px;
    border-bottom: 2px solid #4797D4;
    line-height: 30px;
  }
  .header_btn{
    background-color: #4797D4;
    border:none;
    color: #fff;
    font-size:15px;
    padding:5px 15px;
    border-radius: 4px;
    cursor: pointer;
  }
  .common_content_tip{
    color: #333;
    font-size:14px;
    margin-right:10px;
  }
  .common_contents{
    color: #888;
    font-size:14px;
  }
  /*公司信息*/
  .CompanyInformationLIST_box{
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    width: 800px;
    margin:0 auto;
    padding-top:20px;
  }
  .CompanyInformationLIST{
    display: flex;
    align-items: center;
    width:400px;
    line-height: 30px;
  }
  .add_tankuang{
    width:880px;
    height:700px;
  }
  .CompanyInformation_tankuang_content{
    padding:58px 54px 58px 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
  }
  .CompanyInformation_tankuang_content>li{
    display: flex;
    align-items: center;
    margin-bottom:20px;
  }
  .CompanyInformation_tankuang_content>li>span{
    color: #666;
    font-size:14px;
    width:200px;
    text-align: right;
  }
  .CompanyInformation_tankuang_content>li>input[type='text']{
    color: #666;
    font-size:14px;
    width:200px;
    border:1px solid #ddd;
    padding-left:10px;
    box-sizing: border-box;
    height:30px;
    line-height: 30px;
    outline:none;
  }
  .CompanyInformation_tankuang_content>li>select{
    color: #666;
    font-size:14px;
    width:200px;
    border:1px solid #ddd;
    padding-left:10px;
    box-sizing: border-box;
    outline: none;
    height:30px;
    line-height: 30px;
  }
  .CompanyInformation_tankuang_content>li>ul.radioBOX{
    width:200px;
    padding-left:10px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
  }
  .CompanyInformation_tankuang_content>li>ul.radioBOX>li{
    margin-right:15px;
    cursor: pointer;
  }
  .CompanyInformation_tankuang_content>li>ul.radioBOX i.radio{
    width:14px;
    height:14px;
    background-image: url("img/radio_false.png");
    margin-right:6px;
  }
  .CompanyInformation_tankuang_content>li>ul.radioBOX i.radio.active{
    background-image: url("img/radio_true.png");
  }
  .list_chang{
    -ms-flex:1;
    -webkit-flex:1;
    text-align: center;
    justify-content: center;
  }
  .list_chang>span{
    white-space: nowrap;
    width:auto!important;
  }
  /*法人信息*/
  .legalInformationLIST_box{
    max-width: 800px;
    margin:0 auto;
    padding-top:30px;
  }
  .legalInformationLIST{
    display: flex;
    align-items: center;
    line-height: 30px;
  }
  .legalInformationLIST>input{
    color: #888;
    font-size:11px;
    padding-left:10px;
  }
  /*联系人信息*/
  .ContactsInformationLIST_box{
    max-width: 800px;
    margin:0 auto;
    padding-top:30px;
  }
  .ContactsInformationLIST{
    display: flex;
    align-items: center;
    line-height: 30px;
  }
  .ContactsInformationLIST>input{
    color: #888;
    font-size:11px;
    padding-left:10px;
  }
  /*股东信息*/
  .Shareholder{
    padding-bottom:30px;
  }
  .Shareholder_table{
    width:100%;
    border: 1px solid #eee;
    margin:30px 0 50px 0;
  }
  .Shareholder_table tr {
    height:42px;
    vertical-align: middle;
    line-height: 42px;
  }
  .Shareholder_table thead tr{
    background-color: #EEEEEE;
  }
  .Shareholder_table thead th{
    font-size:14px;
    color: #333;
    text-align: center;
  }
  .Shareholder_table tbody td{
    font-size:14px;
    color: #888;
    text-align: center;
  }
  .Shareholder_table tbody td input{
    font-size:14px;
    color: #888;
    width:auto;
  }
  .Shareholder_table tbody tr:not(:last-child) td{
    border-bottom: 1px solid #eee;
  }
  .Shareholder_editBTN{
    color: #4797D4;
    cursor: pointer;
  }
  .Shareholder_editBTN:after{
    content:'';
    display: inline-block;
    width:1px;
    margin:0 10px;
    height: 20px;
    background: #eee;
    vertical-align: middle;
  }
  .Shareholder_delBTN{
    color: #E24B4B;
    cursor: pointer;
  }
  .Shareholder_tankuang{
    width:600px;
    height:500px;
  }
  .common_tankuang_content{
    padding:40px 0;
    display: block;
  }
  .common_tankuang_content>li{
    flex:1;
  }
  .common_tankuang_content input{
    width:210px!important;
  }
  .common_tankuang_content select{
    width:210px!important;
  }
  .common_tankuang_content span{
    width:200px;
  }
  /*人员结构*/
  #peopleStructure{
    width:100%;
    border: 1px solid #eee;
    margin:30px 0 50px 0;
  }
  #peopleStructure tr {
    height:42px;
    vertical-align: middle;
    line-height: 42px;
  }
  #peopleStructure>tr:nth-child(odd)>th{
    /*font-weight: bold;*/
    background-color: #EEEEEE;
    font-size:14px;
    color: #333;
    text-align: center;
  }
  #peopleStructure>tr:nth-child(even)>td{
    font-size:14px;
    color: #888;
    text-align: center;
    font-weight: normal;
  }
  /*上传营业执照*/
  .upload_box{
    width:273px;
    height:188px;
    position: relative;
    margin-left:200px;
    margin-top:20px;
    margin-bottom:50px;
  }
  .upload_box>img{
    display: inline-block;
    width:100%;
    height:100%;
    margin: 0;
    padding:0;
  }
  .upload_box>input{
    width:100%;
    height:100%;
    position: absolute;
    top:0;
    left:0;
    right:0;
    bottom:0;
    opacity: 0;
  }
  .font_666_16{
    color: #666;
    font-size: 16px;
    text-align: center;
    margin-top:15px;
  }


</style>
